package com.bx.springcloud.controller;

import com.bx.springcloud.IdGeneratorSnowflake;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class SnowflakeIdController {

    @Autowired
    private IdGeneratorSnowflake idGeneratorSnowflake;

    @GetMapping("/generatorSnowflake")
    public String generatorSnowflake() {
        long l = idGeneratorSnowflake.snowflakeId();
        log.info(""+l);
        log.info(""+idGeneratorSnowflake.workerId);
        return "generatorSnowflake";
    }
}
